// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

pub mod storage_control {
    use crate::Result;

    /// Common implementation for [crate::client::StorageControl] request builders.
    #[derive(Clone, Debug)]
    pub(crate) struct RequestBuilder<R: std::default::Default> {
        stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
        request: R,
        options: gax::options::RequestOptions,
    }

    impl<R> RequestBuilder<R>
    where
        R: std::default::Default,
    {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
        ) -> Self {
            Self {
                stub,
                request: R::default(),
                options: gax::options::RequestOptions::default(),
            }
        }
    }

    /// The request builder for [StorageControl::delete_bucket][crate::client::StorageControl::delete_bucket] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_storage::builder;
    /// use builder::storage_control::DeleteBucket;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteBucket {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteBucket(RequestBuilder<crate::model::DeleteBucketRequest>);

    impl DeleteBucket {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeleteBucketRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .delete_bucket(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::DeleteBucketRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [if_metageneration_match][crate::model::DeleteBucketRequest::if_metageneration_match].
        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteBucketRequest::if_metageneration_match].
        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_metageneration_not_match][crate::model::DeleteBucketRequest::if_metageneration_not_match].
        pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteBucketRequest::if_metageneration_not_match].
        pub fn set_or_clear_if_metageneration_not_match<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_not_match = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteBucket {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [StorageControl::get_bucket][crate::client::StorageControl::get_bucket] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_storage::builder;
    /// use builder::storage_control::GetBucket;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetBucket {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetBucket(RequestBuilder<crate::model::GetBucketRequest>);

    impl GetBucket {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetBucketRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Bucket> {
            (*self.0.stub)
                .get_bucket(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [name][crate::model::GetBucketRequest::name].
        ///
        /// This is a **required** field for requests.
        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.name = v.into();
            self
        }

        /// Sets the value of [if_metageneration_match][crate::model::GetBucketRequest::if_metageneration_match].
        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_metageneration_match][crate::model::GetBucketRequest::if_metageneration_match].
        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_metageneration_not_match][crate::model::GetBucketRequest::if_metageneration_not_match].
        pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetBucketRequest::if_metageneration_not_match].
        pub fn set_or_clear_if_metageneration_not_match<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_not_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [read_mask][crate::model::GetBucketRequest::read_mask].
        pub fn set_read_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.read_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [read_mask][crate::model::GetBucketRequest::read_mask].
        pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.read_mask = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetBucket {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [StorageControl::create_bucket][crate::client::StorageControl::create_bucket] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_storage::builder;
    /// use builder::storage_control::CreateBucket;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreateBucket {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreateBucket(RequestBuilder<crate::model::CreateBucketRequest>);

    impl CreateBucket {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::CreateBucketRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Bucket> {
            (*self.0.stub)
                .create_bucket(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [parent][crate::model::CreateBucketRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [bucket][crate::model::CreateBucketRequest::bucket].
        pub fn set_bucket<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Bucket>,
        {
            self.0.request.bucket = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [bucket][crate::model::CreateBucketRequest::bucket].
        pub fn set_or_clear_bucket<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Bucket>,
        {
            self.0.request.bucket = v.map(|x| x.into());
            self
        }

        /// Sets the value of [bucket_id][crate::model::CreateBucketRequest::bucket_id].
        ///
        /// This is a **required** field for requests.
        pub fn set_bucket_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.bucket_id = v.into();
            self
        }

        /// Sets the value of [predefined_acl][crate::model::CreateBucketRequest::predefined_acl].
        pub fn set_predefined_acl<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.predefined_acl = v.into();
            self
        }

        /// Sets the value of [predefined_default_object_acl][crate::model::CreateBucketRequest::predefined_default_object_acl].
        pub fn set_predefined_default_object_acl<T: Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.predefined_default_object_acl = v.into();
            self
        }

        /// Sets the value of [enable_object_retention][crate::model::CreateBucketRequest::enable_object_retention].
        pub fn set_enable_object_retention<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.enable_object_retention = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreateBucket {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [StorageControl::list_buckets][crate::client::StorageControl::list_buckets] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_storage::builder;
    /// use builder::storage_control::ListBuckets;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListBuckets {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListBuckets(RequestBuilder<crate::model::ListBucketsRequest>);

    impl ListBuckets {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListBucketsRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListBucketsResponse> {
            (*self.0.stub)
                .list_buckets(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::ListBucketsResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<crate::model::ListBucketsResponse, gax::error::Error>
        {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [parent][crate::model::ListBucketsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::ListBucketsRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::ListBucketsRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }

        /// Sets the value of [prefix][crate::model::ListBucketsRequest::prefix].
        pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.prefix = v.into();
            self
        }

        /// Sets the value of [read_mask][crate::model::ListBucketsRequest::read_mask].
        pub fn set_read_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.read_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [read_mask][crate::model::ListBucketsRequest::read_mask].
        pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.read_mask = v.map(|x| x.into());
            self
        }

        /// Sets the value of [return_partial_success][crate::model::ListBucketsRequest::return_partial_success].
        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.return_partial_success = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListBuckets {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [StorageControl::lock_bucket_retention_policy][crate::client::StorageControl::lock_bucket_retention_policy] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_storage::builder;
    /// use builder::storage_control::LockBucketRetentionPolicy;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> LockBucketRetentionPolicy {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct LockBucketRetentionPolicy(
        RequestBuilder<crate::model::LockBucketRetentionPolicyRequest>,
    );

    impl LockBucketRetentionPolicy {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::LockBucketRetentionPolicyRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Bucket> {
            (*self.0.stub)
                .lock_bucket_retention_policy(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [bucket][crate::model::LockBucketRetentionPolicyRequest::bucket].
        ///
        /// This is a **required** field for requests.
        pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.bucket = v.into();
            self
        }

        /// Sets the value of [if_metageneration_match][crate::model::LockBucketRetentionPolicyRequest::if_metageneration_match].
        ///
        /// This is a **required** field for requests.
        pub fn set_if_metageneration_match<T: Into<i64>>(mut self, v: T) -> Self {
            self.0.request.if_metageneration_match = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for LockBucketRetentionPolicy {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [StorageControl::update_bucket][crate::client::StorageControl::update_bucket] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_storage::builder;
    /// use builder::storage_control::UpdateBucket;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UpdateBucket {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UpdateBucket(RequestBuilder<crate::model::UpdateBucketRequest>);

    impl UpdateBucket {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::UpdateBucketRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Bucket> {
            (*self.0.stub)
                .update_bucket(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [bucket][crate::model::UpdateBucketRequest::bucket].
        ///
        /// This is a **required** field for requests.
        pub fn set_bucket<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Bucket>,
        {
            self.0.request.bucket = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [bucket][crate::model::UpdateBucketRequest::bucket].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_bucket<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Bucket>,
        {
            self.0.request.bucket = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_metageneration_match][crate::model::UpdateBucketRequest::if_metageneration_match].
        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_metageneration_match][crate::model::UpdateBucketRequest::if_metageneration_match].
        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_metageneration_not_match][crate::model::UpdateBucketRequest::if_metageneration_not_match].
        pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_metageneration_not_match][crate::model::UpdateBucketRequest::if_metageneration_not_match].
        pub fn set_or_clear_if_metageneration_not_match<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_not_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [predefined_acl][crate::model::UpdateBucketRequest::predefined_acl].
        pub fn set_predefined_acl<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.predefined_acl = v.into();
            self
        }

        /// Sets the value of [predefined_default_object_acl][crate::model::UpdateBucketRequest::predefined_default_object_acl].
        pub fn set_predefined_default_object_acl<T: Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.predefined_default_object_acl = v.into();
            self
        }

        /// Sets the value of [update_mask][crate::model::UpdateBucketRequest::update_mask].
        ///
        /// This is a **required** field for requests.
        pub fn set_update_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [update_mask][crate::model::UpdateBucketRequest::update_mask].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UpdateBucket {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [StorageControl::compose_object][crate::client::StorageControl::compose_object] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_storage::builder;
    /// use builder::storage_control::ComposeObject;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ComposeObject {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ComposeObject(RequestBuilder<crate::model::ComposeObjectRequest>);

    impl ComposeObject {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ComposeObjectRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Object> {
            (*self.0.stub)
                .compose_object(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [destination][crate::model::ComposeObjectRequest::destination].
        ///
        /// This is a **required** field for requests.
        pub fn set_destination<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Object>,
        {
            self.0.request.destination = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [destination][crate::model::ComposeObjectRequest::destination].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Object>,
        {
            self.0.request.destination = v.map(|x| x.into());
            self
        }

        /// Sets the value of [source_objects][crate::model::ComposeObjectRequest::source_objects].
        pub fn set_source_objects<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<crate::model::compose_object_request::SourceObject>,
        {
            use std::iter::Iterator;
            self.0.request.source_objects = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [destination_predefined_acl][crate::model::ComposeObjectRequest::destination_predefined_acl].
        pub fn set_destination_predefined_acl<T: Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.destination_predefined_acl = v.into();
            self
        }

        /// Sets the value of [if_generation_match][crate::model::ComposeObjectRequest::if_generation_match].
        pub fn set_if_generation_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_generation_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_generation_match][crate::model::ComposeObjectRequest::if_generation_match].
        pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_generation_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_metageneration_match][crate::model::ComposeObjectRequest::if_metageneration_match].
        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_metageneration_match][crate::model::ComposeObjectRequest::if_metageneration_match].
        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [kms_key][crate::model::ComposeObjectRequest::kms_key].
        pub fn set_kms_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.kms_key = v.into();
            self
        }

        /// Sets the value of [common_object_request_params][crate::model::ComposeObjectRequest::common_object_request_params].
        pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::CommonObjectRequestParams>,
        {
            self.0.request.common_object_request_params = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [common_object_request_params][crate::model::ComposeObjectRequest::common_object_request_params].
        pub fn set_or_clear_common_object_request_params<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<crate::model::CommonObjectRequestParams>,
        {
            self.0.request.common_object_request_params = v.map(|x| x.into());
            self
        }

        /// Sets the value of [object_checksums][crate::model::ComposeObjectRequest::object_checksums].
        pub fn set_object_checksums<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::ObjectChecksums>,
        {
            self.0.request.object_checksums = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [object_checksums][crate::model::ComposeObjectRequest::object_checksums].
        pub fn set_or_clear_object_checksums<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::ObjectChecksums>,
        {
            self.0.request.object_checksums = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ComposeObject {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [StorageControl::delete_object][crate::client::StorageControl::delete_object] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_storage::builder;
    /// use builder::storage_control::DeleteObject;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteObject {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteObject(RequestBuilder<crate::model::DeleteObjectRequest>);

    impl DeleteObject {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::DeleteObjectRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<()> {
            (*self.0.stub)
                .delete_object(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [bucket][crate::model::DeleteObjectRequest::bucket].
        ///
        /// This is a **required** field for requests.
        pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.bucket = v.into();
            self
        }

        /// Sets the value of [object][crate::model::DeleteObjectRequest::object].
        ///
        /// This is a **required** field for requests.
        pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.object = v.into();
            self
        }

        /// Sets the value of [generation][crate::model::DeleteObjectRequest::generation].
        pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
            self.0.request.generation = v.into();
            self
        }

        /// Sets the value of [if_generation_match][crate::model::DeleteObjectRequest::if_generation_match].
        pub fn set_if_generation_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_generation_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_generation_match][crate::model::DeleteObjectRequest::if_generation_match].
        pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_generation_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_generation_not_match][crate::model::DeleteObjectRequest::if_generation_not_match].
        pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_generation_not_match][crate::model::DeleteObjectRequest::if_generation_not_match].
        pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_generation_not_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_metageneration_match][crate::model::DeleteObjectRequest::if_metageneration_match].
        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteObjectRequest::if_metageneration_match].
        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_metageneration_not_match][crate::model::DeleteObjectRequest::if_metageneration_not_match].
        pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteObjectRequest::if_metageneration_not_match].
        pub fn set_or_clear_if_metageneration_not_match<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_not_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [common_object_request_params][crate::model::DeleteObjectRequest::common_object_request_params].
        pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::CommonObjectRequestParams>,
        {
            self.0.request.common_object_request_params = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [common_object_request_params][crate::model::DeleteObjectRequest::common_object_request_params].
        pub fn set_or_clear_common_object_request_params<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<crate::model::CommonObjectRequestParams>,
        {
            self.0.request.common_object_request_params = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteObject {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [StorageControl::restore_object][crate::client::StorageControl::restore_object] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_storage::builder;
    /// use builder::storage_control::RestoreObject;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> RestoreObject {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct RestoreObject(RequestBuilder<crate::model::RestoreObjectRequest>);

    impl RestoreObject {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::RestoreObjectRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Object> {
            (*self.0.stub)
                .restore_object(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [bucket][crate::model::RestoreObjectRequest::bucket].
        ///
        /// This is a **required** field for requests.
        pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.bucket = v.into();
            self
        }

        /// Sets the value of [object][crate::model::RestoreObjectRequest::object].
        ///
        /// This is a **required** field for requests.
        pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.object = v.into();
            self
        }

        /// Sets the value of [generation][crate::model::RestoreObjectRequest::generation].
        ///
        /// This is a **required** field for requests.
        pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
            self.0.request.generation = v.into();
            self
        }

        /// Sets the value of [restore_token][crate::model::RestoreObjectRequest::restore_token].
        pub fn set_restore_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.restore_token = v.into();
            self
        }

        /// Sets the value of [if_generation_match][crate::model::RestoreObjectRequest::if_generation_match].
        pub fn set_if_generation_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_generation_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_generation_match][crate::model::RestoreObjectRequest::if_generation_match].
        pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_generation_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_generation_not_match][crate::model::RestoreObjectRequest::if_generation_not_match].
        pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_generation_not_match][crate::model::RestoreObjectRequest::if_generation_not_match].
        pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_generation_not_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_metageneration_match][crate::model::RestoreObjectRequest::if_metageneration_match].
        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_metageneration_match][crate::model::RestoreObjectRequest::if_metageneration_match].
        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_metageneration_not_match][crate::model::RestoreObjectRequest::if_metageneration_not_match].
        pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_metageneration_not_match][crate::model::RestoreObjectRequest::if_metageneration_not_match].
        pub fn set_or_clear_if_metageneration_not_match<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_not_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [copy_source_acl][crate::model::RestoreObjectRequest::copy_source_acl].
        pub fn set_copy_source_acl<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.copy_source_acl = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [copy_source_acl][crate::model::RestoreObjectRequest::copy_source_acl].
        pub fn set_or_clear_copy_source_acl<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.copy_source_acl = v.map(|x| x.into());
            self
        }

        /// Sets the value of [common_object_request_params][crate::model::RestoreObjectRequest::common_object_request_params].
        pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::CommonObjectRequestParams>,
        {
            self.0.request.common_object_request_params = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [common_object_request_params][crate::model::RestoreObjectRequest::common_object_request_params].
        pub fn set_or_clear_common_object_request_params<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<crate::model::CommonObjectRequestParams>,
        {
            self.0.request.common_object_request_params = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for RestoreObject {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [StorageControl::get_object][crate::client::StorageControl::get_object] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_storage::builder;
    /// use builder::storage_control::GetObject;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetObject {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetObject(RequestBuilder<crate::model::GetObjectRequest>);

    impl GetObject {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::GetObjectRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Object> {
            (*self.0.stub)
                .get_object(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [bucket][crate::model::GetObjectRequest::bucket].
        ///
        /// This is a **required** field for requests.
        pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.bucket = v.into();
            self
        }

        /// Sets the value of [object][crate::model::GetObjectRequest::object].
        ///
        /// This is a **required** field for requests.
        pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.object = v.into();
            self
        }

        /// Sets the value of [generation][crate::model::GetObjectRequest::generation].
        pub fn set_generation<T: Into<i64>>(mut self, v: T) -> Self {
            self.0.request.generation = v.into();
            self
        }

        /// Sets the value of [soft_deleted][crate::model::GetObjectRequest::soft_deleted].
        pub fn set_soft_deleted<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.soft_deleted = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [soft_deleted][crate::model::GetObjectRequest::soft_deleted].
        pub fn set_or_clear_soft_deleted<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<bool>,
        {
            self.0.request.soft_deleted = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_generation_match][crate::model::GetObjectRequest::if_generation_match].
        pub fn set_if_generation_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_generation_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_generation_match][crate::model::GetObjectRequest::if_generation_match].
        pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_generation_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_generation_not_match][crate::model::GetObjectRequest::if_generation_not_match].
        pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_generation_not_match][crate::model::GetObjectRequest::if_generation_not_match].
        pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_generation_not_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_metageneration_match][crate::model::GetObjectRequest::if_metageneration_match].
        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_metageneration_match][crate::model::GetObjectRequest::if_metageneration_match].
        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_metageneration_not_match][crate::model::GetObjectRequest::if_metageneration_not_match].
        pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetObjectRequest::if_metageneration_not_match].
        pub fn set_or_clear_if_metageneration_not_match<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_not_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [common_object_request_params][crate::model::GetObjectRequest::common_object_request_params].
        pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::CommonObjectRequestParams>,
        {
            self.0.request.common_object_request_params = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [common_object_request_params][crate::model::GetObjectRequest::common_object_request_params].
        pub fn set_or_clear_common_object_request_params<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<crate::model::CommonObjectRequestParams>,
        {
            self.0.request.common_object_request_params = v.map(|x| x.into());
            self
        }

        /// Sets the value of [read_mask][crate::model::GetObjectRequest::read_mask].
        pub fn set_read_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.read_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [read_mask][crate::model::GetObjectRequest::read_mask].
        pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.read_mask = v.map(|x| x.into());
            self
        }

        /// Sets the value of [restore_token][crate::model::GetObjectRequest::restore_token].
        pub fn set_restore_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.restore_token = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetObject {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [StorageControl::update_object][crate::client::StorageControl::update_object] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_storage::builder;
    /// use builder::storage_control::UpdateObject;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UpdateObject {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UpdateObject(RequestBuilder<crate::model::UpdateObjectRequest>);

    impl UpdateObject {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::UpdateObjectRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Object> {
            (*self.0.stub)
                .update_object(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [object][crate::model::UpdateObjectRequest::object].
        ///
        /// This is a **required** field for requests.
        pub fn set_object<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Object>,
        {
            self.0.request.object = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [object][crate::model::UpdateObjectRequest::object].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_object<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Object>,
        {
            self.0.request.object = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_generation_match][crate::model::UpdateObjectRequest::if_generation_match].
        pub fn set_if_generation_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_generation_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_generation_match][crate::model::UpdateObjectRequest::if_generation_match].
        pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_generation_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_generation_not_match][crate::model::UpdateObjectRequest::if_generation_not_match].
        pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_generation_not_match][crate::model::UpdateObjectRequest::if_generation_not_match].
        pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_generation_not_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_metageneration_match][crate::model::UpdateObjectRequest::if_metageneration_match].
        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_metageneration_match][crate::model::UpdateObjectRequest::if_metageneration_match].
        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_metageneration_not_match][crate::model::UpdateObjectRequest::if_metageneration_not_match].
        pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_metageneration_not_match][crate::model::UpdateObjectRequest::if_metageneration_not_match].
        pub fn set_or_clear_if_metageneration_not_match<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_not_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [predefined_acl][crate::model::UpdateObjectRequest::predefined_acl].
        pub fn set_predefined_acl<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.predefined_acl = v.into();
            self
        }

        /// Sets the value of [update_mask][crate::model::UpdateObjectRequest::update_mask].
        ///
        /// This is a **required** field for requests.
        pub fn set_update_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [update_mask][crate::model::UpdateObjectRequest::update_mask].
        ///
        /// This is a **required** field for requests.
        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.update_mask = v.map(|x| x.into());
            self
        }

        /// Sets the value of [common_object_request_params][crate::model::UpdateObjectRequest::common_object_request_params].
        pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::CommonObjectRequestParams>,
        {
            self.0.request.common_object_request_params = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [common_object_request_params][crate::model::UpdateObjectRequest::common_object_request_params].
        pub fn set_or_clear_common_object_request_params<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<crate::model::CommonObjectRequestParams>,
        {
            self.0.request.common_object_request_params = v.map(|x| x.into());
            self
        }

        /// Sets the value of [override_unlocked_retention][crate::model::UpdateObjectRequest::override_unlocked_retention].
        pub fn set_override_unlocked_retention<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.override_unlocked_retention = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UpdateObject {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [StorageControl::list_objects][crate::client::StorageControl::list_objects] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_storage::builder;
    /// use builder::storage_control::ListObjects;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListObjects {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListObjects(RequestBuilder<crate::model::ListObjectsRequest>);

    impl ListObjects {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::ListObjectsRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListObjectsResponse> {
            (*self.0.stub)
                .list_objects(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::ListObjectsResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<crate::model::ListObjectsResponse, gax::error::Error>
        {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [parent][crate::model::ListObjectsRequest::parent].
        ///
        /// This is a **required** field for requests.
        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.parent = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::ListObjectsRequest::page_size].
        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
            self.0.request.page_size = v.into();
            self
        }

        /// Sets the value of [page_token][crate::model::ListObjectsRequest::page_token].
        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.page_token = v.into();
            self
        }

        /// Sets the value of [delimiter][crate::model::ListObjectsRequest::delimiter].
        pub fn set_delimiter<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.delimiter = v.into();
            self
        }

        /// Sets the value of [include_trailing_delimiter][crate::model::ListObjectsRequest::include_trailing_delimiter].
        pub fn set_include_trailing_delimiter<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.include_trailing_delimiter = v.into();
            self
        }

        /// Sets the value of [prefix][crate::model::ListObjectsRequest::prefix].
        pub fn set_prefix<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.prefix = v.into();
            self
        }

        /// Sets the value of [versions][crate::model::ListObjectsRequest::versions].
        pub fn set_versions<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.versions = v.into();
            self
        }

        /// Sets the value of [read_mask][crate::model::ListObjectsRequest::read_mask].
        pub fn set_read_mask<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.read_mask = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [read_mask][crate::model::ListObjectsRequest::read_mask].
        pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::FieldMask>,
        {
            self.0.request.read_mask = v.map(|x| x.into());
            self
        }

        /// Sets the value of [lexicographic_start][crate::model::ListObjectsRequest::lexicographic_start].
        pub fn set_lexicographic_start<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.lexicographic_start = v.into();
            self
        }

        /// Sets the value of [lexicographic_end][crate::model::ListObjectsRequest::lexicographic_end].
        pub fn set_lexicographic_end<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.lexicographic_end = v.into();
            self
        }

        /// Sets the value of [soft_deleted][crate::model::ListObjectsRequest::soft_deleted].
        pub fn set_soft_deleted<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.soft_deleted = v.into();
            self
        }

        /// Sets the value of [include_folders_as_prefixes][crate::model::ListObjectsRequest::include_folders_as_prefixes].
        pub fn set_include_folders_as_prefixes<T: Into<bool>>(mut self, v: T) -> Self {
            self.0.request.include_folders_as_prefixes = v.into();
            self
        }

        /// Sets the value of [match_glob][crate::model::ListObjectsRequest::match_glob].
        pub fn set_match_glob<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.match_glob = v.into();
            self
        }

        /// Sets the value of [filter][crate::model::ListObjectsRequest::filter].
        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.filter = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListObjects {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [StorageControl::rewrite_object][crate::client::StorageControl::rewrite_object] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_storage::builder;
    /// use builder::storage_control::RewriteObject;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> RewriteObject {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct RewriteObject(RequestBuilder<crate::model::RewriteObjectRequest>);

    impl RewriteObject {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::RewriteObjectRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::RewriteResponse> {
            (*self.0.stub)
                .rewrite_object(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [destination_name][crate::model::RewriteObjectRequest::destination_name].
        ///
        /// This is a **required** field for requests.
        pub fn set_destination_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.destination_name = v.into();
            self
        }

        /// Sets the value of [destination_bucket][crate::model::RewriteObjectRequest::destination_bucket].
        ///
        /// This is a **required** field for requests.
        pub fn set_destination_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.destination_bucket = v.into();
            self
        }

        /// Sets the value of [destination_kms_key][crate::model::RewriteObjectRequest::destination_kms_key].
        pub fn set_destination_kms_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.destination_kms_key = v.into();
            self
        }

        /// Sets the value of [destination][crate::model::RewriteObjectRequest::destination].
        pub fn set_destination<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Object>,
        {
            self.0.request.destination = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [destination][crate::model::RewriteObjectRequest::destination].
        pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Object>,
        {
            self.0.request.destination = v.map(|x| x.into());
            self
        }

        /// Sets the value of [source_bucket][crate::model::RewriteObjectRequest::source_bucket].
        ///
        /// This is a **required** field for requests.
        pub fn set_source_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.source_bucket = v.into();
            self
        }

        /// Sets the value of [source_object][crate::model::RewriteObjectRequest::source_object].
        ///
        /// This is a **required** field for requests.
        pub fn set_source_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.source_object = v.into();
            self
        }

        /// Sets the value of [source_generation][crate::model::RewriteObjectRequest::source_generation].
        pub fn set_source_generation<T: Into<i64>>(mut self, v: T) -> Self {
            self.0.request.source_generation = v.into();
            self
        }

        /// Sets the value of [rewrite_token][crate::model::RewriteObjectRequest::rewrite_token].
        pub fn set_rewrite_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.rewrite_token = v.into();
            self
        }

        /// Sets the value of [destination_predefined_acl][crate::model::RewriteObjectRequest::destination_predefined_acl].
        pub fn set_destination_predefined_acl<T: Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.destination_predefined_acl = v.into();
            self
        }

        /// Sets the value of [if_generation_match][crate::model::RewriteObjectRequest::if_generation_match].
        pub fn set_if_generation_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_generation_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_generation_match][crate::model::RewriteObjectRequest::if_generation_match].
        pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_generation_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_generation_not_match][crate::model::RewriteObjectRequest::if_generation_not_match].
        pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_generation_not_match][crate::model::RewriteObjectRequest::if_generation_not_match].
        pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_generation_not_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_metageneration_match][crate::model::RewriteObjectRequest::if_metageneration_match].
        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_metageneration_match][crate::model::RewriteObjectRequest::if_metageneration_match].
        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_metageneration_not_match][crate::model::RewriteObjectRequest::if_metageneration_not_match].
        pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_metageneration_not_match][crate::model::RewriteObjectRequest::if_metageneration_not_match].
        pub fn set_or_clear_if_metageneration_not_match<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_not_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_source_generation_match][crate::model::RewriteObjectRequest::if_source_generation_match].
        pub fn set_if_source_generation_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_source_generation_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_source_generation_match][crate::model::RewriteObjectRequest::if_source_generation_match].
        pub fn set_or_clear_if_source_generation_match<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_source_generation_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_source_generation_not_match][crate::model::RewriteObjectRequest::if_source_generation_not_match].
        pub fn set_if_source_generation_not_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_source_generation_not_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_source_generation_not_match][crate::model::RewriteObjectRequest::if_source_generation_not_match].
        pub fn set_or_clear_if_source_generation_not_match<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_source_generation_not_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_source_metageneration_match][crate::model::RewriteObjectRequest::if_source_metageneration_match].
        pub fn set_if_source_metageneration_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_source_metageneration_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_source_metageneration_match][crate::model::RewriteObjectRequest::if_source_metageneration_match].
        pub fn set_or_clear_if_source_metageneration_match<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_source_metageneration_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_source_metageneration_not_match][crate::model::RewriteObjectRequest::if_source_metageneration_not_match].
        pub fn set_if_source_metageneration_not_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_source_metageneration_not_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_source_metageneration_not_match][crate::model::RewriteObjectRequest::if_source_metageneration_not_match].
        pub fn set_or_clear_if_source_metageneration_not_match<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_source_metageneration_not_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [max_bytes_rewritten_per_call][crate::model::RewriteObjectRequest::max_bytes_rewritten_per_call].
        pub fn set_max_bytes_rewritten_per_call<T: Into<i64>>(mut self, v: T) -> Self {
            self.0.request.max_bytes_rewritten_per_call = v.into();
            self
        }

        /// Sets the value of [copy_source_encryption_algorithm][crate::model::RewriteObjectRequest::copy_source_encryption_algorithm].
        pub fn set_copy_source_encryption_algorithm<T: Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.copy_source_encryption_algorithm = v.into();
            self
        }

        /// Sets the value of [copy_source_encryption_key_bytes][crate::model::RewriteObjectRequest::copy_source_encryption_key_bytes].
        pub fn set_copy_source_encryption_key_bytes<T: Into<::bytes::Bytes>>(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.copy_source_encryption_key_bytes = v.into();
            self
        }

        /// Sets the value of [copy_source_encryption_key_sha256_bytes][crate::model::RewriteObjectRequest::copy_source_encryption_key_sha256_bytes].
        pub fn set_copy_source_encryption_key_sha256_bytes<T: Into<::bytes::Bytes>>(
            mut self,
            v: T,
        ) -> Self {
            self.0.request.copy_source_encryption_key_sha256_bytes = v.into();
            self
        }

        /// Sets the value of [common_object_request_params][crate::model::RewriteObjectRequest::common_object_request_params].
        pub fn set_common_object_request_params<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::CommonObjectRequestParams>,
        {
            self.0.request.common_object_request_params = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [common_object_request_params][crate::model::RewriteObjectRequest::common_object_request_params].
        pub fn set_or_clear_common_object_request_params<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<crate::model::CommonObjectRequestParams>,
        {
            self.0.request.common_object_request_params = v.map(|x| x.into());
            self
        }

        /// Sets the value of [object_checksums][crate::model::RewriteObjectRequest::object_checksums].
        pub fn set_object_checksums<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::ObjectChecksums>,
        {
            self.0.request.object_checksums = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [object_checksums][crate::model::RewriteObjectRequest::object_checksums].
        pub fn set_or_clear_object_checksums<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::ObjectChecksums>,
        {
            self.0.request.object_checksums = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for RewriteObject {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [StorageControl::move_object][crate::client::StorageControl::move_object] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use google_cloud_storage::builder;
    /// use builder::storage_control::MoveObject;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> MoveObject {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct MoveObject(RequestBuilder<crate::model::MoveObjectRequest>);

    impl MoveObject {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::StorageControl>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::MoveObjectRequest>>(mut self, v: V) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Object> {
            (*self.0.stub)
                .move_object(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [bucket][crate::model::MoveObjectRequest::bucket].
        ///
        /// This is a **required** field for requests.
        pub fn set_bucket<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.bucket = v.into();
            self
        }

        /// Sets the value of [source_object][crate::model::MoveObjectRequest::source_object].
        ///
        /// This is a **required** field for requests.
        pub fn set_source_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.source_object = v.into();
            self
        }

        /// Sets the value of [destination_object][crate::model::MoveObjectRequest::destination_object].
        ///
        /// This is a **required** field for requests.
        pub fn set_destination_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.destination_object = v.into();
            self
        }

        /// Sets the value of [if_source_generation_match][crate::model::MoveObjectRequest::if_source_generation_match].
        pub fn set_if_source_generation_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_source_generation_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_source_generation_match][crate::model::MoveObjectRequest::if_source_generation_match].
        pub fn set_or_clear_if_source_generation_match<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_source_generation_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_source_generation_not_match][crate::model::MoveObjectRequest::if_source_generation_not_match].
        pub fn set_if_source_generation_not_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_source_generation_not_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_source_generation_not_match][crate::model::MoveObjectRequest::if_source_generation_not_match].
        pub fn set_or_clear_if_source_generation_not_match<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_source_generation_not_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_source_metageneration_match][crate::model::MoveObjectRequest::if_source_metageneration_match].
        pub fn set_if_source_metageneration_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_source_metageneration_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_source_metageneration_match][crate::model::MoveObjectRequest::if_source_metageneration_match].
        pub fn set_or_clear_if_source_metageneration_match<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_source_metageneration_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_source_metageneration_not_match][crate::model::MoveObjectRequest::if_source_metageneration_not_match].
        pub fn set_if_source_metageneration_not_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_source_metageneration_not_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_source_metageneration_not_match][crate::model::MoveObjectRequest::if_source_metageneration_not_match].
        pub fn set_or_clear_if_source_metageneration_not_match<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_source_metageneration_not_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_generation_match][crate::model::MoveObjectRequest::if_generation_match].
        pub fn set_if_generation_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_generation_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_generation_match][crate::model::MoveObjectRequest::if_generation_match].
        pub fn set_or_clear_if_generation_match<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_generation_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_generation_not_match][crate::model::MoveObjectRequest::if_generation_not_match].
        pub fn set_if_generation_not_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_generation_not_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_generation_not_match][crate::model::MoveObjectRequest::if_generation_not_match].
        pub fn set_or_clear_if_generation_not_match<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_generation_not_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_metageneration_match][crate::model::MoveObjectRequest::if_metageneration_match].
        pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_metageneration_match][crate::model::MoveObjectRequest::if_metageneration_match].
        pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_match = v.map(|x| x.into());
            self
        }

        /// Sets the value of [if_metageneration_not_match][crate::model::MoveObjectRequest::if_metageneration_not_match].
        pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_not_match = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [if_metageneration_not_match][crate::model::MoveObjectRequest::if_metageneration_not_match].
        pub fn set_or_clear_if_metageneration_not_match<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.0.request.if_metageneration_not_match = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for MoveObject {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }
}
